<include file="Admin@default/public/header" />
    <div class="toptip">
        <div class="toptit">提示：</div>
        <p class="link_green_line">设置微信小程序前，网站需首先进行申请，获得对应的AppId、AppSecret，以保证后续流程中可正确对小程序与用户进行验证与授权。现在就去<a href="https://mp.weixin.qq.com/" target="_blank">申请</a></p>
    </div>
    <div class="toptit">微信小程序设置</div>
  <form id="form1">
        <div class="form_main width200">
            <div class="fl">微信小程序名称：</div>
            <div class="fr">
                <input name="weixin_applet_appname" type="text" class="input_text_default" value="{:C('qscms_weixin_applet_appname')}"/>
            </div>

            <div class="fl">微信小程序AppId：</div>
            <div class="fr">
                <input name="weixin_applet_appid" type="text" class="input_text_default" value="{:C('qscms_weixin_applet_appid')}"/>
            </div>
            <div class="fl">微信小程序AppSecret：</div>
            <div class="fr">
                <input name="weixin_applet_appsecret" type="text" class="input_text_default" value="{:C('qscms_weixin_applet_appsecret')}"/>
            </div>
            <div style="display: none">
            <div class="fl">微信小程序支付商户号：</div>
            <div class="fr">
                <input name="weixin_applet_mchid" type="text" class="input_text_default" value="{:C('qscms_weixin_applet_mchid')}"/>
            </div>

            <div class="fl">微信小程序支付密钥：</div>
            <div class="fr">
                <input name="weixin_applet_mchkey" type="text" class="input_text_default middle" value="{:C('qscms_weixin_applet_mchkey')}"/>
                <label class="no-fl-note">(消息加解密密钥)</label>
            </div>

            <div class="fl">微信小程序Token授权密钥：</div>
            <div class="fr">
                <input name="weixin_applet_maketoken" type="text" class="input_text_default middle" value="{:C('qscms_weixin_applet_maketoken')}"/>
                <label class="no-fl-note">Token授权加密key（32位字符）,小程序授权登录。</label>
            </div>
            </div>
            <div class="fl"></div>
            <div class="fr">
                <input type="button" id="J_submit" class="admin_submit" value="保存"/>
            </div>
            <div class="clear"></div>
        </div>
  </form>
</div>
<include file="Admin@default/public/footer" />
<script type="text/javascript">
  var uploadUrl = "{:U('Upload/form_upload')}";
</script>
<script src="__ADMINPUBLIC__/js/ajaxfileupload.js"></script>
<script src="__ADMINPUBLIC__/js/fileupload.js"></script>
<script>
    $('#J_submit').click(function(){
        var that = $(this);
        if(that.hasClass('disabled')){
            return false;
        }
        that.val('正在保存...').addClass('disabled');
        $.post("{:U('weixin/index')}",$('#form1').serialize(),function(result){
            if(result.status==1){
                disapperTooltip("success", result.msg,function(){
                    that.val('保存').removeClass('disabled');
                });
            }else{
                disapperTooltip("remind", result.msg,function(){
                    that.val('保存').removeClass('disabled');
                });
                return false;
            }
        },'json');
    });
</script>
</body>
</html>